Skip to content

fix: add TypeScript types and tighten types in NotificationCenter (#306) - #2

Merged
usmanimamu17-create merged 1 commit into
mainfrom
fix/issue-306-notificationcenter-types
Jul 24, 2026
Merged

fix: add TypeScript types and tighten types in NotificationCenter (#306)#2
usmanimamu17-create merged 1 commit into
mainfrom
fix/issue-306-notificationcenter-types

Conversation

@usmanimamu17-create

Copy link
Copy Markdown
Owner

Summary\nTighten TypeScript types in NotificationCenter component to reduce implicit any usage and catch errors at compile-time.\n\n## Changes\n- Added React.FC<NotificationCenterProps> type annotation to component\n- Extracted helper functions outside component with explicit return types (ReactNode, string)\n- Added useCallback wrappers for event handlers with explicit void return types\n- Added explicit type annotations (useState<boolean>, unreadCount: number)\n- Removed redundant type annotations and simplified control flow\n- Added 17 unit tests covering all component states\n\nCloses MettaChain#306

…ttaChain#306)

- Add React.FC<NotificationCenterProps> type annotation to component
- Extract getAlertIcon and getAlertMessage as module-level functions with explicit return types
- Add useCallback wrappers for event handlers with explicit void return types
- Add explicit type annotations: useState<boolean>, unreadCount: number
- Add type-only imports for ReactNode
- Remove redundant type annotation in alert.filter callback
- Simplify control flow by removing else after returns
- Add comprehensive unit tests (17 tests) covering all states
@usmanimamu17-create
usmanimamu17-create merged commit e784517 into main Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant